package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.domain.SystemMessage;
import cn.wolfcode.trip.base.service.ISystemMessageService;
import cn.wolfcode.trip.base.util.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/systemMessages")
public class SystemMessageController {
    @Autowired
    private ISystemMessageService systemMessageService;

    @GetMapping
    public Object getSystemMessage(Long id){
        List<SystemMessage> systemMessages = systemMessageService.selectLikesByUserId(id);
        return systemMessages;
    }
    @PutMapping("/changeState/{id}")
    public Object changeState(@PathVariable Long id){
        systemMessageService.changeState(id);
        return new JSONResult();
    }


}
